package cn.mavor.day0906;

public class Book {
    public static void main(String[] args) {
        // 创建一个Book对象
        Readbook myBook = new Readbook("Java作业：从入门到入土", "合肥大专出版社", "薛五恒", "2024-09-09");
        // 输出书籍的信息
        System.out.println(myBook);
    }
}

class Readbook {
    private String title;       // 书名
    private String publisher;   // 出版社
    private String author;      // 作者
    private String publicationDate; // 出版日期

    // 构造函数
    public Readbook(String title, String publisher, String author, String publicationDate) {
        this.title = title;
        this.publisher = publisher;
        this.author = author;
        this.publicationDate = publicationDate;
    }

    // Getter方法
    public String getTitle() {
        return title;
    }

    public String getPublisher() {
        return publisher;
    }

    public String getAuthor() {
        return author;
    }

    public String getPublicationDate() {
        return publicationDate;
    }

    // 输出书籍信息的方法
    @Override
    public String toString() {
        return "本书信息：{" +
                "书名：“" + title + '”' +
                ", 出版社：”" + publisher + '“' +
                ", 作者：“" + author + '”' +
                ", 出版日期：“" + publicationDate + '”' +
                '}';
    }
}